package com.xuecheng.controller;

import com.xuecheng.model.PageParams;
import com.xuecheng.model.dto.SearchCourseParamDTO;
import com.xuecheng.model.po.CourseIndex;
import com.xuecheng.model.vo.SearchPageResultVO;
import com.xuecheng.service.CourseSearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 课程搜索接口
 */
@Slf4j
@Api(value = "课程搜索接口", tags = "课程搜索接口")
@RestController
@RequestMapping("/course")
public class CourseSearchController {
	
	@Resource
	private CourseSearchService courseSearchService;
	
	
	@ApiOperation("课程搜索列表")
	@GetMapping("/list")
	public SearchPageResultVO<CourseIndex> list(PageParams pageParams, SearchCourseParamDTO searchCourseParamDTO) {
		log.info("课程搜索列表：{}", searchCourseParamDTO);
		return courseSearchService.queryCoursePubIndex(pageParams, searchCourseParamDTO);
		
	}
}
